﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Core;
using SharedGenomics.Domain;

namespace SharedGenomics.DataAccess
{
    public class IndividualSexLookup
    {
        public IndividualSexLookup(IIndividualPhenotypeCollection phenotypes)
        {
            phenotypes.ThrowIfNull("phenotypes");
            this.Phenotypes = phenotypes;
        }

        public virtual Sex this[string id]
        {
            get
            {
                id.ThrowIfNull("id");

                return this.Phenotypes.Contains(id)
                    ? this.Phenotypes[id].Sex
                    : Sex.Unknown;
            }
        }

        private IIndividualPhenotypeCollection Phenotypes { get; set; }
    }
}
